package com.yimi.yinhepda.views.break_card;

import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import com.pda.ym.utils.SysInfo;
import com.pda.ym.base.BaseActivity;
import com.yimi.yinhepda.R;
import com.yimi.yinhepda.utils.Common;

/**
 * G7打卡设置界面
 * @author 000432
 * @date 2018/5/28 0028
 */

public class BreakCardSettingActivity extends BaseActivity {

    /**
     * wifi设置
     */
    private Button btnWiFiSetting;
    /**
     * 本机信息
     */
    private Button btnLocalInfo;
    /**
     * 返回按钮
     */
    private Button btnBack;

    @Override
    public String getPageName() {
        return "G7打卡设置界面";
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_break_card_setting);

        //校验设备型号
        String phoneModel = SysInfo.getInstance().getPhoneModel();
        if (phoneModel.equals(Common.DEV_MODEL)) {
            //横屏
            setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR);
        }

        btnWiFiSetting = (Button) findViewById(R.id.btn_wifi_setting);
        btnLocalInfo = (Button) findViewById(R.id.btn_local_info);
        btnBack = (Button) findViewById(R.id.btn_back);

        btnWiFiSetting.setOnClickListener(this);
        btnLocalInfo.setOnClickListener(this);
        btnBack.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        super.onClick(v);
        switch (v.getId()) {
            case R.id.btn_wifi_setting:
                Intent intent = new Intent(android.provider.Settings.ACTION_WIFI_SETTINGS);
                startActivity(intent);
                break;
            case R.id.btn_local_info:
                toActivity(BreakCardLocalInfoActivity.class);
                finish();
                break;
            case R.id.btn_back:
                finish();
                break;
            default:
                break;
        }
    }
}
